﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Configuration;
using System.Diagnostics;

namespace Axe.Web.Controls.Configuration
{
    public class WikiContentProvidersCollection : ConfigurationElementCollection
    {
        protected override ConfigurationElement CreateNewElement()
        {
            return new WikiContentProviderConfiguration();
        }

        public WikiContentProviderConfiguration GetProvider(string providerName)
        {
            return (WikiContentProviderConfiguration)BaseGet(providerName);
        }

        protected override object GetElementKey(ConfigurationElement element)
        {
            Debug.Assert(element is WikiContentProviderConfiguration, "Passed invalid configuration object type");
            return ((WikiContentProviderConfiguration)element).Name;
        }

        public override ConfigurationElementCollectionType CollectionType
        {
            get
            {
                return ConfigurationElementCollectionType.AddRemoveClearMap;
            }
        }
    }
}
